#!/bin/bash
if [ ! $# == 2 ];then
  echo "Usage: $0 check_service_name check_result[ok/err]"
fi

filename=$1
stat=$2
relationdir="/usr/lib64/nagios/plugins/htcondor_controller/nagios_results/"
if [ ! -d "$relationdir" ]; then
        mkdir -p $relationdir
fi
filepath=$relationdir$filename
#echo $filepath
if [ $stat != 0 ];then
  echo "err" > $filepath
else
  echo "ok" > $filepath
fi
echo $stat

